home *** CD-ROM | disk | FTP | other *** search
- {*******************************************************}
- { }
- { xTool - Component Collection }
- { }
- { Copyright (c) 1995 Stefan B÷ther }
- { }
- {*******************************************************}
- unit Remember;
- { remember various attributes of the owning form }
-
- interface
-
- uses
- WinTypes, WinProcs, SysUtils, Classes, Graphics, Dialogs, Forms, IniFiles;
-
- type
- TRememberOption = (roPosition,roSize,roColor,roFont);
- TRememberOptions = set of TRememberOption;
-
- TRemember = class(TComponent)
- private
- FIniFile : PString;
- FSection : PString;
- FOnWrite : TNotifyEvent;
- FOnRead : TNotifyEvent;
- FNextDestroy: TNotifyEvent;
- FOptions : TRememberOptions;
- function GetIniFile: String;
- function GetSection: String;
- procedure SetIniFile(Value: String);
- procedure SetSection(Value: String);
- procedure WriteRead(IsRead: Boolean);
- procedure FormDestroy(Sender:TObject);
- protected
- FStorage : TIniFile;
- procedure ReadState(Reader: TReader); override;
- public
- constructor Create(aOwner:TComponent); override;
- destructor Destroy; override;
- procedure Write; virtual;
- procedure Read; virtual;
- published
- property IniFile: String read GetIniFile write SetIniFile;
- property Section: String read GetSection write SetSection;
- property Options: TRememberOptions read FOptions write FOptions;
- property OnWrite: TNotifyEvent read FOnWrite write FOnWrite;
- property OnRead: TNotifyEvent read FOnRead write FOnRead;
- end;
-
- procedure Register;
-
-